home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / mx / RCS / mx.man,v < prev   
Text File  |  1990-04-19  |  59KB  |  1,615 lines

  1. head     1.18;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.18
  10. date     90.03.29.11.33.48;  author ouster;  state Exp;
  11. branches ;
  12. next     1.17;
  13.  
  14. 1.17
  15. date     90.03.25.15.20.51;  author ouster;  state Exp;
  16. branches ;
  17. next     1.16;
  18.  
  19. 1.16
  20. date     90.03.22.15.56.53;  author ouster;  state Exp;
  21. branches ;
  22. next     1.15;
  23.  
  24. 1.15
  25. date     90.03.16.08.43.50;  author ouster;  state Exp;
  26. branches ;
  27. next     1.14;
  28.  
  29. 1.14
  30. date     89.12.22.11.03.00;  author ouster;  state Exp;
  31. branches ;
  32. next     1.13;
  33.  
  34. 1.13
  35. date     89.07.16.12.27.59;  author ouster;  state Exp;
  36. branches ;
  37. next     1.12;
  38.  
  39. 1.12
  40. date     89.07.15.17.31.08;  author shirriff;  state Exp;
  41. branches ;
  42. next     1.11;
  43.  
  44. 1.11
  45. date     89.06.22.17.01.50;  author shirriff;  state Exp;
  46. branches ;
  47. next     1.10;
  48.  
  49. 1.10
  50. date     89.06.09.15.40.36;  author ouster;  state Exp;
  51. branches ;
  52. next     1.9;
  53.  
  54. 1.9
  55. date     89.06.08.17.07.47;  author ouster;  state Exp;
  56. branches ;
  57. next     1.8;
  58.  
  59. 1.8
  60. date     89.06.05.12.17.08;  author shirriff;  state Exp;
  61. branches ;
  62. next     1.7;
  63.  
  64. 1.7
  65. date     89.06.02.15.40.58;  author shirriff;  state Exp;
  66. branches ;
  67. next     1.6;
  68.  
  69. 1.6
  70. date     89.03.24.14.17.32;  author ouster;  state Exp;
  71. branches ;
  72. next     1.5;
  73.  
  74. 1.5
  75. date     89.01.19.12.07.36;  author ouster;  state Exp;
  76. branches ;
  77. next     1.4;
  78.  
  79. 1.4
  80. date     89.01.07.13.55.15;  author ouster;  state Exp;
  81. branches ;
  82. next     1.3;
  83.  
  84. 1.3
  85. date     88.12.30.10.03.50;  author ouster;  state Exp;
  86. branches ;
  87. next     1.2;
  88.  
  89. 1.2
  90. date     88.12.23.15.09.59;  author ouster;  state Exp;
  91. branches ;
  92. next     1.1;
  93.  
  94. 1.1
  95. date     88.12.22.10.50.37;  author ouster;  state Exp;
  96. branches ;
  97. next     ;
  98.  
  99.  
  100. desc
  101. @@
  102.  
  103.  
  104. 1.18
  105. log
  106. @Added "where" procedure.
  107. @
  108. text
  109. @'\" Copyright 1989 Regents of the University of California
  110. '\" Permission to use, copy, modify, and distribute this
  111. '\" documentation for any purpose and without fee is hereby
  112. '\" granted, provided that this notice appears in all copies.
  113. '\" The University of California makes no representations about
  114. '\" the suitability of this material for any purpose.  It is
  115. '\" provided "as is" without express or implied warranty.
  116. '\" 
  117. '\" $Header: /sprite/src/cmds/mx/RCS/mx.man,v 1.17 90/03/25 15:20:51 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  118. '
  119. .so \*(]ltmac.sprite
  120. .HS MX cmds
  121. .BS
  122. .SH NAME
  123. mx \- Mouse-oriented editor for X
  124. .SH SYNOPSIS
  125. \fBmx \fR[\fIoptions\fR]  [\fIfile file file ...\fR]
  126. .br
  127. \fBmxsync \fR[\fIoptions\fR]  [\fIfile file file ...\fR]
  128. .SH OPTIONS
  129. .IP "\fB\-bd \fIcolor\fR" 15
  130. Use \fIcolor\fR as the border color for the window.  If this switch
  131. isn't given then the \fBborderColor\fR X default is used.  If it isn't given
  132. either, then the foreground color is used.
  133. .IP "\fB\-bg \fIcolor\fR" 15
  134. Use \fIcolor\fR as the background color for the window.  If this switch
  135. isn't given then the \fBbackground\fR X default is used.  If it isn't given
  136. either, or if the display is a black-and-white one, then White is used.
  137. .IP "\fB\-D\fR" 15
  138. Causes \fBmx\fR not to detach itself from its parent process.  Useful
  139. when \fBmx\fR is invoke from programs that wait for it to finish,
  140. like mail programs.  If \fBmx\fR is invoked under the name \fBmxsync\fR
  141. then \fBmx\fR acts as if this switch had been given.
  142. .IP "\fB\-display \fIhost\fB:\fIdisplay\fR" 15
  143. .VS
  144. Use \fIhost\fR and \fIdisplay\fR as an indication of the
  145. display on which to open the window.  The display defaults to the
  146. one specified in the \fBDISPLAY\fR environment variable.
  147. .IP "\fB\-f\fR" 15
  148. Treat all remaining arguments as file names.  This option must be
  149. used to
  150. edit a file if its name starts with ``\-'' or ``='' or ``+'' or contains
  151. a ``:'' character.
  152. .VE
  153. .IP "\fB\-fg \fIcolor\fR" 15
  154. Use \fIcolor\fR as the foreground color for the window.  If this switch
  155. isn't given then the \fBforeground\fR X default is used.  If it isn't given
  156. either, or if the display is a black-and-white one, then Black is used.
  157. .IP "\fB\-fn \fIfont\fR" 15
  158. Use \fIfont\fR as the font for the window.  If this switch isn't given,
  159. then the \fBfont\fR X default is used as the font.  If it isn't given
  160. either, then the Sx default font is used.
  161. .IP "\fB\-geometry \fIgeometry\fR" 15
  162. .VS
  163. Use \fIgeometry\fR as the geometry for the window.  If no geometry
  164. is specified on the command line, it the geometry defaults to the value of the
  165. \fBgeometry\fR X default.  If no default is specified, then
  166. \fBmx\fR picks a geometry.
  167. .IP \fB\-help\fR
  168. Print out a list of the command-line options (and brief descriptions
  169. of their functions) and exit without opening a window.
  170. .IP "\fB\-icon \fIfile\fR" 15
  171. \fIFile\fR is the name of a file in bitmap format.  Read the file and
  172. use it as the icon for the window.  If \fIfile\fR is \fBlocalhost\fR,
  173. then \fBmx\fR chooses the default icon file corresponding to the local host.
  174. .IP "\fB\-ix \fIxcoord\fR" 15
  175. Display the icon at x-coordinate \fIxcoord\fR.
  176. .IP "\fB\-iy \fIycoord\fR" 15
  177. Display the icon at y-coordinate \fIycoord\fR.
  178. .VE
  179. .IP "\fB\-sb \fIcolor\fR" 15
  180. Use \fIcolor\fR as the background color for the window's scrollbar.
  181. If this switch isn't given then the \fBscrollbar.background\fR
  182. X default is used.  If it isn't given either, then the background
  183. color for the text window is used.
  184. .IP "\fB\-sf \fIcolor\fR" 15
  185. Use \fIcolor\fR as the foreground color for the window's scrollbar.
  186. If this switch isn't given then the \fBscrollbar.foreground\fR
  187. X default is used.  If it isn't given either, then the foreground
  188. color for the text window is used.
  189. .IP "\fB\-se \fIcolor\fR" 15
  190. Use \fIcolor\fR as the color for the window's scrollbar elevator.
  191. If this switch isn't given then the \fBscrollbar.elevator\fR
  192. X default is used.  If it isn't given either, then the background
  193. color for the text window is used.
  194. .IP "\fB\-showtitle\fR" 15
  195. .VS
  196. Display a title bar at the top of the window.  Mx normally assumes
  197. that a window manager will display a title bar;  if your window
  198. manager doesn't, you may wish to use this switch.  If this switch
  199. isn't specified, then Mx checks for a \fBshowTitle\fR X default;
  200. if it exists and contains the string ``yes'', then a title
  201. bar will be displayed.
  202. .VE
  203. .IP "\fB\-t \fItag\fR" 15
  204. Look up \fItag\fP in the tags file of the current directory, open its
  205. file in the new window, and go to the line of the tag.
  206. .IP "\fB\-tb \fIcolor\fR" 15
  207. Use \fIcolor\fR as the background color for the window's title bar.
  208. If this switch isn't given then the \fBtitle.background\fR
  209. X default is used.  If it isn't given either, then the background
  210. color for the text window is used.  This option is ignored if Mx
  211. isn't displaying a title bar.
  212. .IP "\fB\-tf \fIcolor\fR" 15
  213. Use \fIcolor\fR as the foreground color for the window's title bar.
  214. If this switch isn't given then the \fBtitle.foreground\fR
  215. X default is used.  If it isn't given either, then the foreground
  216. color for the text window is used.  This option is ignored if Mx
  217. isn't displaying a title bar.
  218. .IP "\fB\-ts \fIcolor\fR" 15
  219. Use \fIcolor\fR as the color for the window's title stripes.
  220. If this switch isn't given then the \title.stripe\fR
  221. X default is used.  If it isn't given either, then the foreground
  222. color for the text window is used.  This option is ignored if Mx
  223. isn't displaying a title bar.
  224. .IP "\fB+\fR" 15
  225. Position the file so its last line is visible in the window.
  226. .IP "\fB+\fIlineNumber\fR" 15
  227. After opening the file, select the first character of
  228. line "\fIlineNumber\fP and make that line visible in the window.
  229. For this switch, line 1 corresponds to the first line of the file.
  230. .IP "\fB+\fIsearchPattern\fR" 15
  231. After opening the file, search for \fIsearchPattern\fP, just as if a
  232. \fBsearch\fP command had been invoked.  If the first character of
  233. \fIsearchPattern\fP is a slash then the slash is ignored (this is
  234. for vi compatibility and to permit search patterns that begin with
  235. a digit).
  236. .IP "\fB=\fIgeometry\fR" 15
  237. Use \fIgeometry\fR as the geometry specifier for the window (same effect
  238. as the \fB-geometry option).
  239. .IP "\fIhost:display\fR" 15
  240. Use this argument to select the display on which to create the window
  241. (same effect as the \fB-display\fR option).
  242. .BE
  243. .SH INTRODUCTION
  244. \fBMx\fR is a mouse-oriented editor that uses the facilities of the X window
  245. system, the Sx supplementary library, and the Tcl command interpreter.
  246. .VS
  247. It displays a window containing the first
  248. \fIfile\fP argument and permits \fIfile\fP to be edited using the
  249. commands defined
  250. below.  If no \fIfile\fR is specified, then \fBmx\fR displays a file
  251. containing a tutorial introduction to \fBmx\fR.  If \fIfile\fR
  252. is specified as an empty string, then
  253. \fBmx\fR creates a scratch window without any particular file association.
  254. \fBMx\fR normally detaches itself from its parent (as far as its
  255. parent is concerned, \fBmx\fR will have exited);  if the \fB\-D\fR switch
  256. is given, or if \fBmx\fR is invoked under the name \fBmxsync\fR,
  257. then \fBmx\fR doesn't detach itself from its parent.
  258. .VE
  259. .LP
  260. Almost all \fBmx\fR actions are invoked using Tcl commands.  See the Tcl
  261. documentation for information on the basic command syntax and the
  262. built-in Tcl commands.  \fBMx\fR extends the Tcl built-in commands
  263. with additional commands for file editing;  the \fBmx\fR commands are
  264. described in the COMMANDS section below.
  265. Commands may be invoked in
  266. any of three ways:  the command subwindow, pull-down menus, and keystroke
  267. bindings.  The command subwindow is a small entry window that is
  268. displayed at the bottom of the \fBmx\fR window.  When it is displayed,
  269. commands may be entered there.  Pull-down menus appear in a bar at the
  270. top of the \fBmx\fR window, and may be invoked by pressing a mouse button
  271. over the menu name and releasing it over an entry in the menu.  Each menu
  272. entry has a command associated with it;  when the entry is invoked, the
  273. command is executed (see the \fBmenu\fP command for information on
  274. how to create and modify menus).  The third command invocation
  275. mechanism is through
  276. keystroke bindings:  certain keystrokes, or combinations of keystrokes,
  277. have commands associated with them.  When the keystroke sequence is typed,
  278. the associated command is executed (see the \fBbind\fP command for
  279. details).  For example, the ``a'' key
  280. is normally bound to the command \fBinsert a\fR, which causes
  281. character ``a'' to be inserted at the caret location.
  282. .LP
  283. Many commands may be invoked either through a menu entry or a keystroke
  284. binding;  for these commands, the keystroke sequence bound to the command
  285. appears at the right side of the menu entry.
  286.  
  287. .SH ".MX FILES"
  288. After processing command line options, opening the window, and reading
  289. in the file, \fBmx\fR checks for the existence of a file \fB.mx\fR in your
  290. home directory (which is given by the
  291. environment variable HOME).  If the file exists, \fBmx\fR
  292. reads it in and processes it as a command file, just as if it were read
  293. with the \fBsource\fP command.  Then it checks for an \fB.mx\fR file in the
  294. current directory, and processes it if it exists.
  295.  
  296. .SH CARET AND SELECTION
  297. The mouse may be used to position the caret (the insertion point)
  298. and to select ranges of text.  The same actions apply both to the file
  299. or to the search and command subwindows.
  300. Left-clicking on a character positions the caret just before
  301. that character.  Right-clicking will select all of the characters
  302. from the caret up to and including the character under the pointer.
  303. If the left button is clicked twice in quick succession without
  304. moving the mouse, it invokes word selection:  the word containing
  305. the character under the pointer is selected, the caret is positioned
  306. at the left side of the word, and future right clicks will select
  307. only full words.  If the left button is triple-clicked, line selection
  308. will be invoked.  If the control key is held down while left- and
  309. right-clicking, the selection will be set without changing the caret
  310. or input focus.
  311.  
  312. .SH "VARIABLES"
  313. .LP
  314. There are several Tcl global variables that are set or used by \fBmx\fR
  315. in some situations:
  316. .RS
  317. .TP
  318. \fBfile\fP
  319. Set by \fBmx\fR to the name of the file loaded in the window (which is
  320. the first name in \fB$files\fR.
  321. .VS
  322. .TP
  323. \fBfiles\fP
  324. Set by \fBmx\fR to a list of all the \fIfile\fR arguments specified on the
  325. command line that created the window.
  326. .VE
  327. .TP
  328. \fBgeometry\fP
  329. Geometry to use when creating new windows, if none is given as part
  330. of the \fBopen\fR command.  See the
  331. \fBopen\fP command for details.
  332. .TP
  333. \fBheight\fP
  334. Set by \fBmx\fR to indicate
  335. the height of the window, in lines of text.  If the last line
  336. appearing in the window is only partially visible, it doesn't count.
  337. .TP
  338. \fBhelpDir\fP
  339. \fBMx\fR presets this variable to the location of the directory containing
  340. help information such as the tutorials.
  341. .TP
  342. \fBhistory\fP
  343. \fBMx\fR automatically changes this variable on each mouse click to hold
  344. information about all the recently-executed commands.  Several of
  345. the default key bindings and menu entries also set this variable.
  346. See the HISTORY section and the \fBhistory\fR command for more
  347. information.
  348. .TP
  349. \fBnewWindow\fR
  350. During the \fBopen\fR command, \fBmx\fR sets this global variable to hold
  351. the id of the newly-created window.
  352. .TP
  353. \fBnoRegExps\fR
  354. If this variable is set to ``1'', searches and replaces will use plain
  355. strings.  By default, pattern matching takes place with vi-style regular
  356. expressions.
  357. .TP
  358. \fBreplaceCmd\fP
  359. When the middle button is clicked in the ``Replace'' string entry, or when
  360. carriage-return is typed there, the contents of this variable are
  361. executed as a command.
  362. .TP
  363. \fBreplaceString\fP
  364. Set by \fBmx\fR to hold the contents of the replacement entry subwindow.
  365. .TP
  366. \fBsearchCmd\fP
  367. When the middle button is clicked in the ``Search'' string entry, or when
  368. carriage-return is typed there, the contents of this variable are
  369. executed as a command.
  370. .TP
  371. \fBsearchString\fP
  372. Set by \fBmx\fR to hold the contents of the search entry subwindow.
  373. .TP
  374. \fBtagFiles\fP
  375. List of tags files to check in \fBtag\fP command, separated by
  376. white space.  See the \fBtag\fP command for details.  This variable
  377. is read by \fBmx\fR but not written.
  378. .TP
  379. \fBversion\fR
  380. .VS
  381. Set by \fBmx\fR to hold a version number in the form \fIx.y\fR, where
  382. changes in \fIx\fR correspond to major revisions with probable
  383. incompatibilities, and changes in \fIy\fR represent small bug fixes
  384. and upgrades that should not cause substantial compatibility problems.
  385. .VE
  386. .TP
  387. \fBwidth\fP
  388. The width of the window, in characters.  If the last character position
  389. is only partially-visible, then it doesn't count.  If a variable-width
  390. font is being used, the average character size is used in computing
  391. the window's width.
  392. .RE
  393.  
  394. .SH "MARKS"
  395. .PP
  396. A mark is a string that identifies a position in the file.  It
  397. has the format
  398. .DS
  399. \fIline\fB.\fIchar\fR
  400. .DE
  401. where \fIline\fR is a line number in the file and \fIchar\fR is
  402. a position within that line.  For historical reasons, lines
  403. number from 1 and characters number from 0.
  404. .PP
  405. Most commands that deal with positions in the file, such as
  406. \fBsee\fP and \fBdelete\fP, take marks as arguments.  Typically,
  407. marks are stored as the values of variables, although they may also be
  408. typed in directly.  The \fBmark\fP command provides for simple mark
  409. arithmetic.  The position indicated in a mark
  410. need not actually exist in the file;  at the time the mark is used it
  411. is rounded off to the closest actual position in the file.  For example,
  412. if the line number doesn't exist in the file then it is changed to
  413. the last line;  if the character position would like off the end of
  414. the line, then it is rounded to the position of the last character
  415. in the line.
  416. .LP
  417. When a command specifies that one of its arguments must be a mark,
  418. the mark may either be specified in the \fIline.char\fR form
  419. (either directly or through command or variable substitution),
  420. or it may be specified symbolically using one of the following names, which
  421. refer to special locations:
  422. .RSquit
  423. .TP
  424. \fBbottom\fP
  425. This special mark refers to
  426. the character that appears in the bottom left corner of the window.
  427. .TP
  428. \fBcaret\fP
  429. The special mark \fBcaret\fP corresponds to the character just to
  430. the right of the caret position.
  431. .TP
  432. \fBcenter\fP
  433. The leftmost character on the center line of the window.
  434. .TP
  435. \fBeof\fP
  436. The last character in the file (which is always a newline character).
  437. .TP
  438. \fBsel.left\fP
  439. The leftmost selected character.  This form of mark may only be used
  440. if the selection is in the file that's in this window.
  441. .TP
  442. \fBsel.right\fP
  443. The rightmost selected character.  This form of mark may only be used
  444. if the selection is in the file that's in this window.
  445. .TP
  446. \fBtop\fP
  447. The character that appears in the top left corner of the window.
  448.  
  449. .SH "HISTORY"
  450. Under normal circumstances,
  451. \fBMx\fR continuously records all the top-level commands being executed,
  452. including those coming from keystrokes, menu entries, and the command,
  453. search, and replace subwindows.
  454. On each button click, undo, or search operation, all of the recorded
  455. commands are saved in the variable \fBhistory\fR and the record is
  456. cleared.  Thus the \fBhistory\fR variable describes all the commands
  457. executed between the last two events in the above group.  It may
  458. then be invoked as a command to repeat recent actions.
  459. .PP
  460. Under normal circumstances, \fBmx\fR does not record information about
  461. mouse clicks,  searching, undoing, or \fBhistory\fR commands.
  462. In addition, changes of focus to the command, search, 
  463. or replace subwindows are not normally recorded.  Having these commands
  464. included in the \fBhistory\fR variable turns out to cause more trouble
  465. than good.  However, much of this behavior is enforced by using
  466. the \fBhistory\fR command in the key
  467. bindings and menus established by the \fBmx\fR startup file, so you can
  468. change it if you wish.  Only the mouse click behavior and \fBmx\fR's refusal
  469. to record \fBhistory\fR commands are hard-wired.  See the \fBhistory\fR
  470. command for information on how to control command recording.
  471.  
  472. .SH "COMMANDS"
  473. The \fBmx\fR built-in commands are described below.  In addition to these
  474. commands, any of the Tcl built-in commands may also be used.
  475. Whenever a top-level command is invoked (i.e. in response to a keystroke or
  476. menu selection, as opposed to the execution of a command procedure), if it
  477. returns a non-empty result then the result is displayed in the message
  478. window.  If the command returns an error then the error message is
  479. displayed in the message window.
  480. .TP
  481. \fBbind \fR[\fIsequence\fR [\fIcommand\fR]]
  482. If the \fIsequence\fR and \fIcommand\fR arguments are given,
  483. this command associates
  484. the keystroke sequence \fIsequence\fR with \fIcommand\fR and
  485. returns an empty string.
  486. From now on, whenever \fIsequence\fP is typed in the window,
  487. the Tcl interpreter will be invoked to execute \fIcommand\fP.
  488. If \fIsequence\fP is already bound to a command, then
  489. \fIcommand\fP replaces the previous binding.  If there are two bound
  490. sequences of which one is a prefix of the other, then the shorter
  491. sequence will always match in preference to the longer one.
  492. If \fIcommand\fR is an empty string, then the binding for \fIsequence\fR
  493. (if any) is deleted, leaving \fIsequence\fP unbound.
  494. .RS
  495. .PP
  496. If the first character of \fIcommand\fP is ``!'', it signifies that
  497. no undo marks are to be generated around this command;  the ``!'' is
  498. stripped from the command before executing it.  If several key bindings
  499. in a row are invoked and each had the ``!'' prefix, then all of the
  500. invocations will be undone together as a single unit.  If \fIcommand\fP
  501. consists of nothing but the character ``\fB@@\fP'' (optionally preceded
  502. by ``!''), then whenever this
  503. binding is invoked the command ``\fBinsert \fIkey\fR'' will be executed,
  504. where \fIkey\fR is the last key typed on the keyboard.  ``\fB!@@\fR''
  505. is typically used as the binding for all the standard ASCII
  506. characters.
  507. .PP
  508. If \fIcommand\fR isn't specified, then the \fIbind\fR command returns
  509. the current binding for \fIsequence\fR, or the empty string if there
  510. is no binding for \fIsequence\fR.  If neither \fIsequence\fR or \fIcommand\fR
  511. is given, then \fBbind\fR returns a Tcl list whose elements are the
  512. \fIsequence\fRs associated with all known keystroke bindings.
  513. .RE
  514. .TP
  515. \fBcaret \fImark\fR
  516. .TP
  517. \fBcaret display \fItype\fR
  518. .VS
  519. In the single-argument form of this command, the caret is moved to
  520. just before the character at the position given by \fImark\fP.
  521. The two-argument form is used to change the way the caret position
  522. is displayed.  If \fItype\fR is \fBcaret\fR, the caret position will
  523. always be marked by displaying a caret just before the caret
  524. character.  If \fItype\fR is \fBblock\fR, the
  525. caret position will be marked by displaying the caret character in
  526. reverse video.  If \fItype\fR is \fBoff\fR, then the caret position
  527. will not be marked with any sort of special display.  Finally, a \fItype\fR
  528. of \fBviblock\fR marks the caret position with a block when in vi mode
  529. and with a caret otherwise (this mode is only relevant for \fBtx\fR).
  530. The \fBcaret\fR command returns an empty string.
  531. .VE
  532. .TP
  533. \fBclean\fR
  534. Pretend that the contents of this window were just written to disk (but
  535. don't actually write anything).  Until the next time the file is
  536. modified, \fBmx\fR will assume that the window is ``clean'':  if you invoke
  537. commands like \fBquit\fR or \fBswitch\fR then \fBmx\fR will happily discard the
  538. contents of the window without warning you or giving you a chance to
  539. abort the command.
  540. .TP
  541. \fBcolumn \fImark\fR
  542. Return the column corresponding to the left edge of the character
  543. at the position indicated by \fImark\fR.  \fIMark\fR must be a valid
  544. mark.  Columns are computed by treating normal characters as one
  545. column wide, control characters as two columns wide, and tabs as
  546. wide enough to extend up to the next 8-column boundary.  Character 0
  547. of a line is at column 0.
  548. .TP
  549. \fBcontrol \fIoption string\fP
  550. This command performs control-character processing on \fIstring\fR,
  551. depending on the value of \fBoption\fR (abbreviations are OK):
  552. .RS
  553. .TP
  554. \fBcontrol backslash \fIstring\fR
  555. Returns a string that is identical to \fIstring\fR except that
  556. non-printing characters are replaced with backslash sequences.
  557. The newline control character is replaced with \fB\en\fR, tab is
  558. replaced with \fB\et\fR, backspace is replaced with \fB\eb\fR, and
  559. any other non-printing character is replaced with \fB\e\fIddd\fR
  560. where \fIddd\fR gives the octal value of the character.
  561. .TP
  562. \fBcontrol binding \fIstring\fR
  563. This command is used primarily to produce a printable description of
  564. a keystroke sequence that is bound to a command.  It returns a string
  565. consisting of space-separated fields corresponding to the characters
  566. of \fIstring\fR.  If a \fIstring\fR character is space, its
  567. corresponding field is ``SPACE'';  if the \fIstring\fR character
  568. is a normal printing character then the field is just that
  569. character;  if the \fIstring\fR character is
  570. rubout (177\d\s-18\s+1\u) the corresponding field is ``DEL'';
  571. if the \fIstring\fR character is a control character, the
  572. corresponding field is of the form ``C-a''; if the \fIstring\fR
  573. character has its high-order bit set (200\d\s-1\8\s+1\u), then the
  574. field is the same as if the high-order bit were not set, except that
  575. ``M-'' is prepended (301\d\s-1\8\s+1\u translates to ``M-A'').
  576. .TP
  577. \fBcontrol make \fIstring\fR
  578. Returns a string of the same length as \fIstring\fR.  Each character in
  579. the result is the control equivalent
  580. of the \fIstring\fR character (e.g., ``a'' and ``A''
  581. convert to control-A).  The character ``?'' converts to
  582. rubout (177\d\s-1\8\s+1\u).
  583. You may not use this command to generate a null character (0).
  584. .RE
  585. .TP
  586. \fBdelete\fR \fImark1 \fR[\fImark2\fR [\fBnoviewchange\fR]]
  587. Delete all of the characters between \fImark1\fP and \fImark2\fP,
  588. inclusive.  If \fImark2\fR isn't specified, then delete the single
  589. character at \fImark1\fR.  Normally, this command changes the
  590. view in the window if necessary to ensure that the point of the
  591. deletion is visible;  if \fBnoviewchange\fR is specified then
  592. the view in the window will not be changed.  Returns an empty string.
  593. .TP
  594. \fBextract\fR \fImark1 \fR[\fImark2\fR]
  595. Return as result all of the characters in the file between the two
  596. marks \fImark1\fR and \fImark2\fR.  If \fImark2\fR is omitted, then
  597. return the single character at \fImark1\fR.
  598. .TP
  599. \fBfocus \fIwindow \fR[\fBclear\fR]
  600. Arrange for all future keyboard input to be directed to \fIwindow\fR,
  601. regardless of the mouse position.  \fIWindow\fR must have one of the
  602. following values (or a unique abbreviation for it):
  603. .RS
  604. .TP
  605. \fBcommand\fR
  606. The command window that appears at the bottom of the file.
  607. .TP
  608. \fBfile\fR
  609. The main window, which displays the file being edited.
  610. .TP
  611. \fBreplace\fR
  612. The replace entry, which is part of the search/replace window that
  613. appears just underneath the menu bar.
  614. .TP
  615. \fBsearch\fR
  616. The search entry in the search/replace window.
  617. .RE
  618. .IP
  619. If \fIwindow\fR isn't displayed when this command is invoked, \fBmx\fR
  620. displays it.  Ifthe \fBclear\fR option is specified (or any
  621. abbreviation of \fBclear\fR) then the contents of the given window
  622. are cleared.  The \fBclear\fR option is ignored if \fIwindow\fR
  623. is \fBfile\fR.  If input focussing has been disabled by the .Xdefaults
  624. file, then \fBfocus\fR will open and/or clear \fIwindow\fR, but will
  625. not focus on it.  Returns an empty string.
  626. .TP
  627. \fBgeometry \fIspec\fR
  628. Set the size and/or location of the window according to the information
  629. in \fIspec\fR.  \fISpec\fR should be in the standard format for X geometry
  630. specifications (\fB=80x24\fR, for example).  Returns an empty string.
  631. .TP
  632. \fBhistory\fR \fIoption\fR [\fIarg\fR]
  633. Control the history recording process.  The exact function
  634. depends on \fIoption\fR (which may be abbreviated uniquely):
  635. .RS
  636. .TP
  637. \fBhistory add \fIinfo\fR
  638. Append \fIinfo\fR to the current history record as if it had been
  639. invoked as a command.  Returns an empty string.
  640. .TP
  641. \fBhistory clear\fR
  642. Discard all of the information in the current history record.
  643. Returns an empty string.
  644. .TP
  645. \fBhistory ignore \fIcommand\fR
  646. Execute \fIcommand\fR but don't record it in the history record.
  647. Note that no \fBhistory\fR commands are ever recorded, even if they don't
  648. appear as the \fIcommand\fR argument to \fBhistory ignore\fR.
  649. Returns an empty string.
  650. .TP
  651. \fBhistory info\fR
  652. Returns the current history record, with commands separated by
  653. newlines.
  654. .TP
  655. \fBhistory next \fIvarName\fR [\fIcommand\fR]
  656. Store the current history record in the variable \fIvarName\fR,
  657. then clear the history record.  After clearing the history
  658. record, if \fIcommand\fR is specified then execute it but don't
  659. record it.  Returns an empty string.
  660. .TP
  661. \fBhistory off\fR
  662. Disable history recording.  Invocations of \fBhistory off\fR
  663. nest:  recording will not resume until an equal number of
  664. \fBhistory on\fR commands have been invoked.  Returns an empty string.
  665. .TP
  666. \fBhistory on\fR
  667. Re-enable history recording if the cumulative number of \fBhistory on\fR
  668. commands is greater than or equal to the number of \fBhistory off\fR
  669. commands.  This command is ignored if history recording is already
  670. enabled.  Returns an empty string.
  671. .RE
  672. .TP
  673. \fBindent\fR \fImark1 mark2\fR [\fB+\fR|\fB\-\fR] \fIamount\fR
  674. Change the indentation of all the lines between \fImark1\fP
  675. and \fImark2\fP, inclusive.  If no sign is given, then \fIamount\fP
  676. specifies an absolute indentation:  for each of the lines,
  677. the indentation will be set to \fIamount\fP.  If \fIamount\fP is
  678. preceded by a minus (plus) argument, then the indentation of each line will be
  679. reduced (increased) by \fIamount\fP units.
  680. To set the indentation for a line to \fIi\fP, \fBmx\fR deletes all the
  681. leading blanks and tabs in the line, then inserts \fIi\fP/8 tabs followed
  682. by (\fIi\fP mod 8) spaces.  Returns an empty string.
  683. .TP
  684. \fBinsert\fR \fIbytes\fR [\fImark\fR]
  685. If \fImark\fR is specified, it contains a mark;  \fBinsert\fR
  686. will insert the contents of the \fIbytes\fR
  687. argument just before the character at position \fImark\fR.  Otherwise
  688. the command will insert \fIbytes\fR at the position of the caret.
  689. Returns an empty string.
  690. .TP
  691. \fBmark\fI src op args\fR
  692. Return a position in the file in the form \fIline.char\fR, where
  693. \fIline\fR is a line in the file and \fIchar\fR is a character in
  694. the line (lines number from 1, characters from 0).
  695. \fISrc\fR must be a valid mark;
  696. the return value is computed
  697. by performing some operation on the position given by \fIsrc\fP,
  698. depending on \fIop\fR and \fIargs\fR:
  699. .RS
  700. .TP
  701. \fBmark \fIsrc\fR
  702. Return the value of mark \fIsrc\fR.  This form is used to retrieve
  703. the value of a built-in mark such as \fBsel.left\fR.
  704. .TP
  705. \fBmark \fIsrc direction amount units\fP
  706. Return the position of
  707. the character \fIamount units\fP away from \fIsrc\fP.  \fISrc\fP
  708. must be a valid mark.  \fIDirection\fP
  709. must be \fBforward\fP or \fBbackward\fP; it indicates which direction
  710. to move from \fIsrc\fP.  \fIAmount\fP is a decimal number indicating
  711. how far to move, and \fIunits\fP indicates the units for motion:
  712. \fBchars\fP, \fBwords\fP, or \fBlines\fP.  For example,
  713. \fBmark $b forward 1 word\fP will set variable \fBa\fP to
  714. point to the beginning of the word just after the one containing
  715. the position indicated by variable \fBb\fP.
  716. .TP
  717. \fBmark \fIsrc \fBchar \fIindex\fR
  718. Return the position of the \fIindex\fP'th character in the line
  719. given by \fIsrc\fP.  If \fIindex\fR is -1, then \fIdst\fP will
  720. refer to the last character on \fIsrc\fR's line.
  721. .TP
  722. \fBmark \fIsrc \fBcolumn \fIindex\fR
  723. Return the position of the character that covers column \fIindex\fR
  724. on the line containing \fIsrc\fR.  Columns are computed by treating
  725. normal characters as one space wide, control characters as two
  726. spaces wide, tabs as wide enough to extend up to the next 8-column
  727. boundary, and the newline at the end of the line as infinitely wide.
  728. Columns number from 0.
  729. .TP
  730. \fBmark \fIsrc \fBline \fIindex\fR
  731. Return the position whose line number is \fIindex\fP but whose
  732. character position is the same as \fIsrc\fP's.
  733. .TP
  734. \fBmark \fIsrc \fBparenthesis\fR [\fIvarName\fR]
  735. Return the position of the first character of the
  736. parenthesis that matches the one pointed
  737. to by \fIsrc\fP.  If \fIsrc\fP doesn't point to a parenthesis, then
  738. return \fIsrc\fP.  If \fIvarName\fP
  739. is specified, then it names a variable that is set to refer to the
  740. last character of the matching parenthesis (this feature is only useful
  741. for parentheses that are more than one character long).
  742. .TP
  743. \fBmark \fIsrc \fBsearch \fIdirection pattern\fR [\fIvarName\fR]
  744. Search for \fIpattern\fP and return the position of the first character
  745. of the matching range.  If \fIvarName\fP is given, it names a
  746. variable that is set to the
  747. last character of the matching range.  The search starts at the
  748. position given by \fIsrc\fP and continues in \fIdirection\fP,
  749. which must be either \fBforward\fP or \fBbackward\fP.  The search
  750. is circular:  if a forward search reaches the end of the file then
  751. it continues at the beginning;  if a backward search reaches the
  752. beginning of the file then it continues at the end.  If no match
  753. is found, then \fIsrc\fR is returned (and stored in the variable
  754. named by \fIvarName\fP, if specified).
  755. .RE
  756. .TP
  757. \fBmenu\fI option \fR[args\fR]
  758. The \fBmenu\fP command is used to manipulate the pull-down menus
  759. displayed at the top of the window.  It has several forms, depending
  760. on \fIoption\fP:
  761. .RS
  762. .TP
  763. \fBmenu append \fIname leftText centerText rightText color cmd\fR
  764. Append a new entry onto menu \fIname\fR, which must already exist.
  765. The \fIleftText\fP,
  766. \fIcenterText\fP, and \fIrightText\fP arguments give strings to be
  767. displayed left-justified, centered, and right-justified (respectively)
  768. in the menu entry.  If any of the arguments is an empty string or the
  769. single character ``-'', then no text is displayed in that position.
  770. \fIColor\fP gives the background color to use for the entry;  if it is
  771. an empty string or ``-'' then the standard background color for the
  772. window is used.  \fICmd\fP is a command to invoke whenever the menu
  773. entry is invoked.  Returns an empty string.
  774. .TP
  775. \fBmenu create \fIname leftText centerText rightText color cmd leftText ...\fR
  776. Create a new menu, which will be displayed to the right of any existing
  777. menus in the menu bar.  The new menu's name will be \fIname\fP.  If there is
  778. already a menu named \fIname\fR, then it will be replaced (the new menu
  779. will occupy the same position in the menu bar as the old menu).
  780. Following the \fIname\fP
  781. argument are any number of groups of five arguments, with each group
  782. describing one entry in the new menu from top down. The five arguments
  783. for each menu entry have the same meaning as for \fBmenu append\fP.
  784. Returns an empty string.
  785. .TP
  786. \fBmenu delete \fIname\fP
  787. Delete the menu named \fIname\fP and return an empty string.
  788. .TP
  789. \fBmenu info\fR
  790. Return a Tcl list whose entries are the names of the menus for this
  791. window, in order.
  792. .TP
  793. \fBmenu info \fIname\fR
  794. Returns a Tcl list containing information about menu \fIname\fR.  Each entry
  795. in the list corresponds to one entry in the menu, in order from top
  796. down.  Each entry is itself a Tcl list with four entries, which
  797. are the \fIleftText\fR, \fIcenterText\fR, \fIrightText\fR, and \fIcmd\fR
  798. values from \fBmenu create\fR or \fBmenu append\fR.
  799. .TP
  800. \fBmenu modify \fIname entryIndex leftText centerText rightText color cmd\fR
  801. Change the \fIentryIndex\fR'th entry in menu \fIname\fP as indicated
  802. by arguments \fIleftText\fP through \fIcmd\fP.  Each of these five
  803. arguments has the same meaning as in \fBmenu append\fP.  Entry 0 is
  804. the topmost entry in the menu.  Returns an empty string.
  805. .RE
  806. .VS
  807. .TP
  808. \fBmessage \fIstring\fR
  809. Display \fIstring\fR in the message subwindow.
  810. .VE
  811. .TP
  812. \fBnewline\fP
  813. Insert a newline character at the position of the caret, and
  814. adjust indentation.  If the caret's initial line
  815. consists of nothing but space, then all the space on the line is
  816. deleted.  If the caret's initial line contains leading space, it
  817. is reorganized to consist of zero or more tabs followed by zero or
  818. more space characters, such that the total width of white space is
  819. the same after the change as before (a tab counts for eight characters).
  820. Tabs and spaces are inserted on the caret's new line to match the
  821. indentation of the caret's initial line.
  822. .TP
  823. \fBopen \fR[\fIoptions\fR] \fIfile\fR \fIfile\fR ...
  824. .VS
  825. Open a new window.  \fIOptions\fR and
  826. \fIfile\fR arguments are treated just the same as they are treated
  827. on the command line, except for the following exceptions.  The \fB-D\fR
  828. option is not permitted, nor are options that specify a display.
  829. If \fIfile\fR is not specified, a new window is opened on the same
  830. file as the current window.  If no geometry specification is given in
  831. \fIoptions\fR, then \fBmx\fR uses the contents of the global variable
  832. \fBgeometry\fP as a default geometry;  if no \fBgeometry\fP variable
  833. exists, then \fBmx\fR picks a default geometry.  Other options, such
  834. as foreground color and font, default to the values from the invoking
  835. window, rather than looking for X defaults.
  836. \fBOpen\fR sets the global variable
  837. \fBnewWindow\fR in the invoking window
  838. to hold the id of the newly-created window.  This may
  839. be used in conjunction with the \fBsend\fR command to issue commands
  840. to the new window.  The return value is always an empty string.
  841. .VE
  842. .TP
  843. \fBquit\fP
  844. Destroy the window.  If this is the last remaining window on its file
  845. and if the file has been modified since the last time it was written,
  846. then the user is notified and given a chance to save the file or
  847. abort the command.  This command always returns an error, in order to
  848. abort any partially-executed commands that are in progress (execution
  849. of further commands on the window could cause a core dump).
  850. .TP
  851. \fBquote\fP
  852. .VS
  853. Quote the next input character.  The mapping for the next character will
  854. be ignored and the character will be inserted.  The return value is always
  855. an empty string.
  856. .VE
  857. .TP
  858. \fBread \fIfile\fR
  859. Read \fIfile\fP and insert its contents just before the caret.
  860. .TP
  861. \fBreplace \fR[\fIoption args\fR]
  862. Replace the selection, as determined by \fIoption\fR and \fIargs\fR:
  863. .RS
  864. .TP
  865. \fBreplace\fP
  866. If no \fIoption\fP is given, then replace the selection by the value
  867. of the \fBreplaceString\fP global variable.  If the
  868. search subwindow isn't visible, don't do any replacement but open
  869. the search subwindow and focus input on the replacement string entry.
  870. .TP
  871. \fBreplace range\fR \fIstart stop\fR [\fIpattern string\fR]
  872. Search the range of text between the marks \fIstart\fR and \fIstop\fR,
  873. inclusive for occurrences of \fIpattern\fP.
  874. Replace each occurrence with
  875. \fIstring\fP.  If \fIpattern\fP and \fIstring\fP aren't specified, then
  876. they are taken from the \fBsearchString\fP and \fBreplaceString\fR
  877. global variables.  If the search subwindow isn't visible, don't
  878. do any replacement but open the search subwindow and focus input
  879. on the replacement string entry.
  880. .VS
  881. By default, vi-style regular expressions are used for the pattern and
  882. replacement strings.
  883. If the variable ``noRegExps'' is set to ``1'', only simple matching is done:
  884. there are no wild cards.
  885. Matches must be within a single line of the file.
  886. .VE
  887. .TP
  888. \fBreplace selection \fIstring\fP
  889. Delete the selection and insert \fIstring\fP in its place.
  890. .RE
  891. The \fBreplace\fR command always returns an empty string.
  892. .TP
  893. \fBreset\fR
  894. .VS
  895. Discard the version of the file that is currently loaded in memory and
  896. re-load the file from its disk version.  Any changes that have been
  897. made since the last time the file was saved will be lost (but you'll
  898. be warned in this case and given a chance to skip the command).  This
  899. command will affect all of the windows open on the file.
  900. .VE
  901. .TP
  902. \fBsearch \fR[\fIdirection \fR[\fIpattern\fR]]
  903. Search for a pattern.  The search starts from the beginning of
  904. the selection (if there is a selection in the window's file),
  905. or from the caret if there's no selection.  \fIDirection\fR indicates which
  906. direction to search, and must be either \fBforward\fR or
  907. \fBbackward\fR.  If omitted, it defaults to \fBforward\fR.
  908. \fIPattern\fP gives a text string to search for;  if not
  909. given, it defaults to the global variable \fBsearchString\fP.  If the
  910. search subwindow isn't visible, don't do any searching but open the
  911. search subwindow and focus input on the search string entry.
  912. .VS
  913. By default, vi-style regular expressions are used for the pattern and
  914. replacement strings.
  915. If the variable ``noRegExps'' is set to ``1'', only simple matching is done:
  916. there are no wild cards.
  917. Matches must be within a single line of the file.
  918. .VE
  919. If a match is found, the matching range is selected and the caret
  920. is set to the beginning of the range.  Returns an empty string.
  921. .TP
  922. \fBsee \fImark\fP [\fBtop\fR|\fBcenter\fR|\fBbottom\fR]
  923. Adjust the view in the window so that the character at \fImark\fP
  924. is visible in the window.  If a \fBtop\fR or \fBcenter\fR or \fBbottom\fR
  925. option is given, then the mark will appear at the given position in
  926. the window.  If no position is given, then \fBmx\fR will check to see if
  927. \fImark\fR is already visible.  If so, it does nothing.  If not, it
  928. will center \fImark\fR in the window.  Returns an empty string.
  929. .TP
  930. \fBselection \fIoption \fR[\fIarg ...\fR]
  931. This command performs one of several selection-related operations,
  932. depending on \fIoption\fR:
  933. .RS
  934. .TP
  935. \fBselection\fR
  936. .TP
  937. \fBselection get\fR
  938. If \fBselection\fR is invoked with no \fIoption\fR, or if \fIoption\fR
  939. is \fBget\fR, then the command returns the contents of the selection.
  940. An error occurs if there's nothing selected.  The command \fBselection\fR
  941. is different from the command \fIextract sel.left sel.right\fR:
  942. \fBselection\fR will return the contents of the selection even if
  943. the selection is in another window, but
  944. \fBextract sel.left sel.right\fR can only return
  945. information from this window.
  946. .TP
  947. \fBselection clear\fR
  948. .VS
  949. If there is something selected in this window, the selection is cleared,
  950. so nothing will be selected.  If there is nothing selected in this window,
  951. there is no effect.  Returns an empty string.
  952. .VE
  953. .TP
  954. \fBselection here\fR
  955. Returns \fB1\fR if there is something selected in the file in this window.
  956. Returns \fB0\fR if there is no selection or if the selection is not in
  957. this window's file.
  958. .TP
  959. \fBselection set \fImark1 \fR[\fImark2\fR]
  960. Change the selection to consist of the characters between \fImark1\fP
  961. and \fImark2\fP, inclusive.  If \fImark2\fR isn't specified,
  962. then select the single character at \fImark1\fR.  Returns an empty string.
  963. .RE
  964. .TP
  965. \fBsend \fIwindow command\fR
  966. \fIWindow\fR must be the id of another window owned by this \fBmx\fR process
  967. (such as a value placed in \fBnewWindow\fR by \fBopen\fR).  The \fBsend\fR
  968. command will invoke the Tcl interpreter to process \fIcommand\fR in
  969. the context of \fIwindow\fR, rather than the window from which the
  970. \fBsend\fR command was issued.  \fBSend\fR will return the result
  971. of executing \fIcommand\fR in \fIwindow\fR.
  972. .TP
  973. \fBswitch \fIfileName\fR
  974. Change the window to display \fIfileName\fR instead of what's there
  975. currently.  If the file currently in the window has been modified, and
  976. if this is the only window on the file, then a notifier is popped up
  977. to warn the user and give him/her a chance to abort the command.
  978. .TP
  979. \fBtaginfo \fIname\fR
  980. Look up \fIname\fP in the tags file(s).  If
  981. it is found, then return a Tcl list whose first element is the file
  982. containing \fIname\fR and whose second element is a search pattern
  983. identifying the tag's location in the file.
  984. If the global variable \fBtagFiles\fR is defined, it must contain a list of
  985. tags files to check.  Those files will be
  986. checked for \fIname\fP in order.  If no \fBtagFiles\fP variable exists,
  987. then the file \fBtags\fP in the current directory is searched.
  988. .TP
  989. \fBundo \fR[\fBmore\fR]
  990. .TP
  991. \fBundo recover \fIfileName\fR
  992. Undo recent edits.  If \fBundo\fR is invoked without any arguments,
  993. the most recent modification to the file is undone;  multiple
  994. invocations will toggle the change.  If the
  995. \fBmore\fR argument is given, successive undo's work back through
  996. history;  successive \fBundo more\fP commands will undo every change
  997. back to the beginning of the edit session.  Modifications are undone
  998. in groups delimited by marks in an undo log;  normally,
  999. a mark is placed in the log before and after each user-invoked action
  1000. (button click, menu selection, or keystroke) that modifies the file.
  1001. Exceptions to this rule occur for keystrokes whose bindings have the
  1002. ``!'' prefix:  no marks are placed in the log for these actions.
  1003. Returns an empty string.  If the \fBrecover\fR option is given, 
  1004. then \fIfileName\fR must be the address of a \fBmx\fR log.  This command
  1005. will read \fIfileName\fR, which describes changes made in a previous
  1006. edit session, and apply those changes to the current file.
  1007. .TP
  1008. \fBupdate\fR
  1009. Force the screen to get updated.  Normally the screen is updated only
  1010. at the end of processing a command, just before waiting for more input
  1011. from the user.  This command will force any pending redisplays to
  1012. be performed immediately.  It's used mostly for debugging.
  1013. Returns an empty string.
  1014. .TP
  1015. \fBwrite \fR[\fIfileName\fR]
  1016. Write the file to disk.  If \fIfileName\fR is given then the
  1017. file is written there;  otherwise it is written to the place from
  1018. which it was read (i.e. the name displayed in the window's title
  1019. bar).  Returns a message containing the file's name and number of
  1020. lines.
  1021.  
  1022. .SH "COMMAND PROCEDURES"
  1023. In addition to the built-in commands described above, a number of Tcl
  1024. command procedures are created by the default \fBmx\fR startup file.  They
  1025. may be invoked just like built-in commands, and are described below.
  1026. .TP
  1027. \fBcaretinfo\fR
  1028. Returns a string containing information about the file's length and
  1029. the position of the caret.
  1030. .TP
  1031. \fBline \fIi\fR
  1032. Selects line number \fIi\fR and adjusts the view in the window so that
  1033. the line number is visible.  Returns an empty string.
  1034. .TP
  1035. \fBmove\fR
  1036. This command moves the contents of the selection to the caret position.
  1037. Returns an empty string.
  1038. .TP
  1039. \fBnext\fR
  1040. .VS
  1041. This command switches to the next \fIfile\fR of those specified on the
  1042. command line by deleting the first element of the variable \fB$files\fR
  1043. and switching the window to the new first element of \fB$files\fR.
  1044. .VE
  1045. .TP
  1046. \fBshowBindings \fIbinding binding ...\fR
  1047. Open a scratch window and display information about keystroke
  1048. bindings in it.  If
  1049. no \fIbinding\fR argument is given, then display information about all
  1050. of the keystroke bindings that are currently defined.
  1051. If one or more \fIbinding\fR arguments are given, then
  1052. just display information for the given bindings.
  1053. Returns an empty string.
  1054. .TP
  1055. \fBshowMenus \fIname name ...\fR
  1056. Open a scratch window and display information about menus in it.  If
  1057. no \fIname\fR argument is given, then display information for all the
  1058. menus that are currently defined.
  1059. If one or more \fIname\fR arguments are given, then
  1060. just display information for the named menus.
  1061. Returns an empty string.
  1062. .TP
  1063. \fBshowProcs \fIname name ...\fR
  1064. Open a scratch window and display procedure information in it.  If
  1065. no \fIname\fR argument is given, then display information about all
  1066. the procedures that are currently defined.
  1067. If one or more \fIname\fR arguments are given, then
  1068. just display information for the named procedures.
  1069. Returns an empty string.
  1070. .TP
  1071. \fBshowVars \fIname name ...\fR
  1072. .VS
  1073. Open a scratch window and display variable values in it.  If
  1074. no \fIname\fR argument is given, then display the values of all
  1075. variables known in the context of the caller of \fBshowVars\fR.
  1076. If one or more \fIname\fR arguments are given, then
  1077. just show the values of those variables. Returns an empty string.
  1078. .VE
  1079. .TP
  1080. \fBtag \fIname\fR
  1081. Invoke the \fBtaginfo\fR command to look up \fIname\fR, then open
  1082. a new window on its file, select the definition of \fIname\fR,
  1083. and make the selected line visible in the new window.
  1084. Returns an empty string.
  1085. .TP
  1086. \fBwhere\fR
  1087. .VS
  1088. Open a scratch window and display information about where the
  1089. last error occurred.  The error information is taken from the
  1090. \fBerrorInfo\fR global variable.
  1091. .VE
  1092.  
  1093. .SH "COMMAND SUBWINDOW"
  1094. The command subwindow allows commands to be typed in directly,
  1095. instead of invoking them through keystroke bindings or menus.
  1096. When active, it appears at the bottom of the \fBmx\fR window.  It can
  1097. be activated with the \fBcommand\fR or \fBfocus\fR commands.
  1098. Commands may be entered and
  1099. edited in the command subwindow, and are invoked by typing
  1100. carriage-return or by middle-clicking in the window.  When a command
  1101. is invoked, it is not deleted from the command subwindow, in order
  1102. to permit it to be re-invoked easily.  The
  1103. command window is de-activated by typing \fB^Q\fR in it.
  1104.  
  1105. .SH "SEARCH SUBWINDOW"
  1106. The search subwindow is used to enter search and replacement strings.
  1107. When active, it appears at the top of the \fBmx\fR window, just underneath
  1108. the menu bar.  If it isn't active and a search or replacement command
  1109. is invoked that requires one of its entries, then the window is
  1110. activated.  It may also be activated using the \fBfocus\fR
  1111. command.  The top entry in the window is used to enter a search
  1112. pattern and the bottom entry is used to enter a replacement string.
  1113. The values of these two entries are always available in the \fBsearchString\fR
  1114. and \fBreplaceString\fR global variables, respectively.
  1115. If carriage-return is typed in the ``Search:'' entry, or if the middle
  1116. mouse button is clicked in the entry, then the the contents of the
  1117. global variable \fBsearchCmd\fR are invoked as a Tcl command.
  1118. If carriage-return is typed in the ``Replace:'' entry, or
  1119. if it is middle-buttoned, then the contents of the global variable
  1120. \fBreplaceCmd\fR are invoked as a Tcl command.
  1121. The search subwindow can be deactivated by typing \fB^Q\fR in it.
  1122.  
  1123. .SH KEYWORDS
  1124. editor, mouse, window
  1125. @
  1126.  
  1127.  
  1128. 1.17
  1129. log
  1130. @Document "reset" command.
  1131. @
  1132. text
  1133. @d9 1
  1134. a9 1
  1135. '\" $Header: /sprite/src/cmds/mx/RCS/mx.man,v 1.16 90/03/22 15:56:53 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1136. d743 1
  1137. a744 1
  1138. \fBquote\fP
  1139. d963 1
  1140. a964 1
  1141. \fBshowVars \fIname name ...\fR
  1142. d977 7
  1143. @
  1144.  
  1145.  
  1146. 1.16
  1147. log
  1148. @Document "mxsync".
  1149. @
  1150. text
  1151. @d9 1
  1152. a9 1
  1153. '\" $Header: /sprite/src/cmds/mx/RCS/mx.man,v 1.15 90/03/16 08:43:50 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1154. d784 9
  1155. @
  1156.  
  1157.  
  1158. 1.15
  1159. log
  1160. @Changed "showGlobals" to "showVars".
  1161. @
  1162. text
  1163. @d9 1
  1164. a9 1
  1165. '\" $Header: /sprite/src/cmds/mx/RCS/mx.man,v 1.14 89/12/22 11:03:00 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1166. d18 2
  1167. d32 2
  1168. a33 1
  1169. like mail programs.
  1170. d146 4
  1171. @
  1172.  
  1173.  
  1174. 1.14
  1175. log
  1176. @Eliminate -notitle switch, add -showtitle.
  1177. @
  1178. text
  1179. @d9 1
  1180. a9 1
  1181. '\" $Header: /sprite/src/cmds/mx/RCS/mx.man,v 1.13 89/07/16 12:27:59 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1182. a930 7
  1183. \fBshowGlobals \fIname name ...\fR
  1184. Open a scratch window and display global variable values in it.  If
  1185. no \fIname\fR argument is given, then display the values of all global
  1186. variables.  If one or more \fIname\fR arguments are given, then
  1187. just show the values of those variables.
  1188. Returns an empty string.
  1189. .TP
  1190. d946 9
  1191. @
  1192.  
  1193.  
  1194. 1.13
  1195. log
  1196. @Modified "caret" command slightly, added "-f" switch.
  1197. @
  1198. text
  1199. @d9 1
  1200. a9 1
  1201. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.12 89/07/15 17:31:08 shirriff Exp Locker: ouster $ SPRITE (Berkeley)
  1202. a66 2
  1203. .IP "\fB\-notitle\fR" 15
  1204. Do not display a title bar at the top of the window.
  1205. d83 9
  1206. d99 2
  1207. a100 1
  1208. color for the text window is used.
  1209. d105 2
  1210. a106 1
  1211. color for the text window is used.
  1212. d111 2
  1213. a112 1
  1214. color for the text window is used.
  1215. @
  1216.  
  1217.  
  1218. 1.12
  1219. log
  1220. @updated manual for block cursor.
  1221. @
  1222. text
  1223. @d9 1
  1224. a9 1
  1225. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.11 89/06/22 17:01:50 shirriff Exp Locker: shirriff $ SPRITE (Berkeley)
  1226. d36 5
  1227. d390 3
  1228. a392 1
  1229. \fBcaret \fIoperand\fR
  1230. d394 12
  1231. a405 10
  1232. If the operand is ``caret'', ``block'', ``viblock'', or ``off'' the cursor type
  1233. will be changed.
  1234. Otherwise the caret is moved to just before the character at the
  1235. position given by \fImark\fP.
  1236. The operand ``caret'' sets the cursor to the normal caret.  The operand
  1237. ``block'' sets the cursor to a block cursor.  The operand ``viblock''
  1238. is only applicable to tx.  It sets the cursor to a caret normally and
  1239. to a block when inside visual mode.  The operand ``off'' disables the
  1240. cursor.
  1241. Returns an empty string.
  1242. @
  1243.  
  1244.  
  1245. 1.11
  1246. log
  1247. @Added 'quote' function.
  1248. @
  1249. text
  1250. @d9 1
  1251. a9 1
  1252. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.10 89/06/09 15:40:36 ouster Exp $ SPRITE (Berkeley)
  1253. d385 13
  1254. a397 3
  1255. \fBcaret \fImark\fR
  1256. Move the caret to just before the character at the position given by
  1257. \fImark\fP.  Returns an empty string.
  1258. @
  1259.  
  1260.  
  1261. 1.10
  1262. log
  1263. @A few new switches.
  1264. Plus version.
  1265. @
  1266. text
  1267. @d9 1
  1268. a9 1
  1269. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.9 89/06/08 17:07:47 ouster Exp $ SPRITE (Berkeley)
  1270. d706 7
  1271. @
  1272.  
  1273.  
  1274. 1.9
  1275. log
  1276. @Updates for a few new switches (-notitle, -display, etc.) plus
  1277. $files and "next" command.
  1278. @
  1279. text
  1280. @d9 1
  1281. a9 1
  1282. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.8 89/06/05 12:17:08 shirriff Exp Locker: ouster $ SPRITE (Berkeley)
  1283. d54 8
  1284. d248 8
  1285. @
  1286.  
  1287.  
  1288. 1.8
  1289. log
  1290. @Updated manual for regular expression matching.
  1291. @
  1292. text
  1293. @d9 1
  1294. a9 1
  1295. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.7 89/06/02 15:40:58 shirriff Exp Locker: shirriff $ SPRITE (Berkeley)
  1296. d17 1
  1297. a17 1
  1298. \fBmx \fR[\fIoptions\fR]  [\fIfile\fR]
  1299. d19 18
  1300. d41 21
  1301. a61 8
  1302. .IP "\fB\-bg \fIcolor\fR" 15
  1303. Use \fIcolor\fR as the background color for the window.  If this switch
  1304. isn't given then the \fBbackground\fR X default is used.  If it isn't given
  1305. either, or if the display is a black-and-white one, then White is used.
  1306. .IP "\fB\-bd \fIcolor\fR" 15
  1307. Use \fIcolor\fR as the border color for the window.  If this switch
  1308. isn't given then the \fBborderColor\fR X default is used.  If it isn't given
  1309. either, then the foreground color is used.
  1310. a66 5
  1311. .IP "\fB\-sb \fIcolor\fR" 15
  1312. Use \fIcolor\fR as the background color for the window's scrollbar.
  1313. If this switch isn't given then the \fBscrollbar.background\fR
  1314. X default is used.  If it isn't given either, then the background
  1315. color for the text window is used.
  1316. d72 8
  1317. a84 5
  1318. .IP "\fB\-tb \fIcolor\fR" 15
  1319. Use \fIcolor\fR as the background color for the window's title bar.
  1320. If this switch isn't given then the \fBtitle.background\fR
  1321. X default is used.  If it isn't given either, then the background
  1322. color for the text window is used.
  1323. a89 10
  1324. .IP "\fB\-fn \fIfont\fR" 15
  1325. Use \fIfont\fR as the font for the window.  If this switch isn't given,
  1326. then the \fBfont\fR X default is used as the font.  If it isn't given
  1327. either, then the Sx default font is used.
  1328. .IP "\fB\-t \fItag\fR" 15
  1329. Look up \fItag\fP in the tags file of the current directory, open its
  1330. file in the new window, and go to the line of the tag.
  1331. .IP "\fB\-D\fR" 15
  1332. Used most often when \fBmx\fR is being debugged.  Causes \fBmx\fR not to detach itself
  1333. from its parent process.
  1334. d103 2
  1335. a104 3
  1336. Use \fIgeometry\fR as the geometry specifier for the window.  If this
  1337. switch is not specified, then the \fBgeometry\fR X default is
  1338. used, if it exists.
  1339. d106 2
  1340. a107 3
  1341. Use this argument to select the display on which to create the window.
  1342. If not given, then the \fBDISPLAY\fR environment variable is used to indicate
  1343. a display.
  1344. d111 10
  1345. a120 5
  1346. system, the Sx supplementary library, and the Tcl command
  1347. interpreter.  It displays a window containing
  1348. \fIfile\fP and permits \fIfile\fP to be edited using the commands defined
  1349. below.  If \fIfile\fR isn't specified, then \fBmx\fR displays a file
  1350. containing a tutorial introduction on how to use \fBmx\fR.
  1351. d181 8
  1352. a188 1
  1353. Set by \fBmx\fR to the name of the file loaded in the window.
  1354. d646 1
  1355. d650 1
  1356. d663 13
  1357. a675 8
  1358. \fBopen \fIfile\fR [\fB=\fIgeometry\fR]
  1359. Open a new window displaying \fIfile\fR.  The \fIgeometry\fP argument,
  1360. if present,  describes the location
  1361. and size of the new window in standard X fashion.  If \fIgeometry\fP
  1362. isn't given, then \fBmx\fR uses the contents of the global variable \fBgeometry\fP
  1363. as a default geometry;  if no \fBgeometry\fP variable exists, then
  1364. \fBmx\fR picks a default geometry.  If \fIfile\fR is an empty string, then
  1365. \fBmx\fR creates a scratch window, without any particular file association.
  1366. d677 2
  1367. a678 1
  1368. \fBnewWindow\fR to hold the id of the newly-created window.  This may
  1369. d681 1
  1370. d713 1
  1371. d719 1
  1372. d736 1
  1373. d742 1
  1374. d772 1
  1375. d776 1
  1376. d862 7
  1377. @
  1378.  
  1379.  
  1380. 1.7
  1381. log
  1382. @Added "selection clear"
  1383. @
  1384. text
  1385. @d9 1
  1386. a9 1
  1387. '\" $Header: /a/newcmds/mx/RCS/mx.man,v 1.6 89/03/24 14:17:32 ouster Exp $ SPRITE (Berkeley)
  1388. d186 5
  1389. d675 5
  1390. d696 5
  1391. a700 2
  1392. At present, only simple matching is done:  there are no wild cards.
  1393. Furthermore, matches must be within a single line of the file.
  1394. a718 5
  1395. \fBselection clear\fR
  1396. If there is something selected in this window, the selection is cleared,
  1397. so nothing will be selected.  If there is nothing selected in this window,
  1398. there is no effect.
  1399. .TP
  1400. d728 5
  1401. @
  1402.  
  1403.  
  1404. 1.6
  1405. log
  1406. @Change comment sequence from ' to '\".
  1407. @
  1408. text
  1409. @d9 1
  1410. a9 1
  1411. '\" $Header: /sprite/src/lib/tcl/RCS/Tcl.man,v 1.3 89/03/24 14:15:39 ouster Exp $ SPRITE (Berkeley)
  1412. d705 5
  1413. @
  1414.  
  1415.  
  1416. 1.5
  1417. log
  1418. @Added "message" command.
  1419. @
  1420. text
  1421. @d1 10
  1422. a10 1
  1423. ' $Header: /a/newcmds/mx/RCS/mx.man,v 1.4 89/01/07 13:55:15 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1424. @
  1425.  
  1426.  
  1427. 1.4
  1428. log
  1429. @More switches to support color better.
  1430. @
  1431. text
  1432. @d1 1
  1433. a1 1
  1434. ' $Header: /a/newcmds/mx/RCS/mx.man,v 1.3 88/12/30 10:03:50 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1435. d603 3
  1436. @
  1437.  
  1438.  
  1439. 1.3
  1440. log
  1441. @More format upgrades.
  1442. @
  1443. text
  1444. @d1 1
  1445. a1 1
  1446. ' $Header: /a/newcmds/mx/RCS/mx.man,v 1.2 88/12/23 15:09:59 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1447. d18 34
  1448. @
  1449.  
  1450.  
  1451. 1.2
  1452. log
  1453. @Document "noviewchange" arg to "delete".
  1454. @
  1455. text
  1456. @d1 1
  1457. a1 1
  1458. ' $Header: /a/newcmds/mx/RCS/mx.man,v 1.1 88/12/22 10:50:37 ouster Exp Locker: ouster $ SPRITE (Berkeley)
  1459. d10 1
  1460. a10 1
  1461. .IP "\fB-fg \fIcolor\fR" 15
  1462. d12 1
  1463. a12 1
  1464. isn't given then the ``foreground'' X default is used.  If it isn't given
  1465. d14 1
  1466. a14 1
  1467. .IP "\fB-bg \fIcolor\fR" 15
  1468. d16 1
  1469. a16 1
  1470. isn't given then the ``background'' X default is used.  If it isn't given
  1471. d18 1
  1472. a18 1
  1473. .IP "\fB-fn \fIfont\fR" 15
  1474. d20 1
  1475. a20 1
  1476. then the ``font'' X default is used as the font.  If it isn't given
  1477. d22 1
  1478. a22 1
  1479. .IP "\fB-t \fItag\fR" 15
  1480. d25 2
  1481. a26 2
  1482. .IP "\fB-D\fR" 15
  1483. Used most often when Mx is being debugged.  Causes Mx not to detach itself
  1484. d42 1
  1485. a42 1
  1486. switch is not specified, then the ``geometry'' X default is
  1487. d46 1
  1488. a46 1
  1489. If not given, then the DISPLAY environment variable is used to indicate
  1490. d50 1
  1491. a50 1
  1492. Mx is a mouse-oriented editor that uses the facilities of the X window
  1493. d54 2
  1494. a55 2
  1495. below.  If \fIfile\fR isn't specified, then Mx displays a file
  1496. containing a tutorial introduction on how to use Mx.
  1497. d57 1
  1498. a57 1
  1499. Almost all Mx actions are invoked using Tcl commands.  See the Tcl
  1500. d59 2
  1501. a60 2
  1502. built-in Tcl commands.  Mx extends the Tcl built-in commands
  1503. with additional commands for file editing;  the Mx commands are
  1504. d65 1
  1505. a65 1
  1506. displayed at the bottom of the Mx window.  When it is displayed,
  1507. d67 1
  1508. a67 1
  1509. top of the Mx window, and may be invoked by pressing a mouse button
  1510. d86 1
  1511. a86 1
  1512. in the file, Mx checks for the existence of a file ``.mx'' in your
  1513. d88 1
  1514. a88 1
  1515. environment variable HOME).  If the file exists, Mx
  1516. d90 1
  1517. a90 1
  1518. with the \fBsource\fP command.  Then it checks for an .mx file in the
  1519. d111 1
  1520. a111 1
  1521. There are several Tcl global variables that are set or used by Mx
  1522. d116 1
  1523. a116 1
  1524. Set by Mx to the name of the file loaded in the window.
  1525. d124 1
  1526. a124 1
  1527. Set by Mx to indicate
  1528. d129 1
  1529. a129 1
  1530. Mx presets this variable to the location of the directory containing
  1531. d133 1
  1532. a133 1
  1533. Mx automatically changes this variable on each mouse click to hold
  1534. d140 1
  1535. a140 1
  1536. During the \fBopen\fR command, Mx sets this global variable to hold
  1537. d149 1
  1538. a149 1
  1539. Set by Mx to hold the contents of the replacement entry subwindow.
  1540. d157 1
  1541. a157 1
  1542. Set by Mx to hold the contents of the search entry subwindow.
  1543. d162 1
  1544. a162 1
  1545. is read by Mx but not written.
  1546. d228 1
  1547. a228 1
  1548. Mx continuously records all the top-level commands being executed,
  1549. d237 1
  1550. a237 1
  1551. Under normal circumstances, Mx does not record information about
  1552. d244 2
  1553. a245 2
  1554. bindings and menus established by the Mx startup file, so you can
  1555. change it if you wish.  Only the mouse click behavior and Mx's refusal
  1556. d250 1
  1557. a250 1
  1558. The Mx built-in commands are described below.  In addition to these
  1559. d299 2
  1560. a300 2
  1561. modified, Mx will assume that the window is ``clean'':  if you invoke
  1562. commands like \fBquit\fR or \fBswitch\fR then Mx will happily discard the
  1563. d382 1
  1564. a382 1
  1565. If \fIwindow\fR isn't displayed when this command is invoked, Mx
  1566. d436 1
  1567. a436 1
  1568. \fBindent\fR \fImark1 mark2\fR [\fB+\fR|\fB-\fR] \fIamount\fR
  1569. d443 1
  1570. a443 1
  1571. To set the indentation for a line to \fIi\fP, Mx deletes all the
  1572. d585 1
  1573. a585 1
  1574. isn't given, then Mx uses the contents of the global variable \fBgeometry\fP
  1575. d587 2
  1576. a588 2
  1577. Mx picks a default geometry.  If \fIfile\fR is an empty string, then
  1578. Mx creates a scratch window, without any particular file association.
  1579. d649 1
  1580. a649 1
  1581. the window.  If no position is given, then Mx will check to see if
  1582. d682 1
  1583. a682 1
  1584. \fIWindow\fR must be the id of another window owned by this Mx process
  1585. d720 1
  1586. a720 1
  1587. then \fIfileName\fR must be the address of a Mx log.  This command
  1588. d740 1
  1589. a740 1
  1590. command procedures are created by the default Mx startup file.  They
  1591. d796 1
  1592. a796 1
  1593. When active, it appears at the bottom of the Mx window.  It can
  1594. d807 1
  1595. a807 1
  1596. When active, it appears at the top of the Mx window, just underneath
  1597. @
  1598.  
  1599.  
  1600. 1.1
  1601. log
  1602. @Initial revision
  1603. @
  1604. text
  1605. @d1 1
  1606. a1 1
  1607. ' $Header: /sprite/src/lib/mx/RCS/mx.man,v 1.1 88/12/22 10:49:48 ouster Exp $ SPRITE (Berkeley)
  1608. d349 1
  1609. a349 1
  1610. \fBdelete\fR \fImark1 \fR[\fImark2\fR]
  1611. d352 4
  1612. a355 1
  1613. character at \fImark1\fR.  Returns an empty string.
  1614. @
  1615.